<?php echo $this->element('paginator_ajax_settings'); ?>
<h1>Xem tất cả users</h1>

<table class="table1">
    <tr>
        <th><?php echo $this->Paginator->sort('Tên đăng nhập', 'username'); ?></th>
        <th><?php echo $this->Paginator->sort('Họ tên', 'fullname'); ?></th>
        <th><?php echo $this->Paginator->sort('Vai trò', 'role'); ?></th>
        <th></th>
    </tr>
    <?php foreach ($users as $user): ?>
    <tr>
        <td><?php echo $this->Html->link($user['User']['username'], array('controller' => 'users', 'action' => 'edit', $user['User']['id'])); ?></td>
        <td><?php echo $user['User']['fullname']; ?></td>
        <td><?php echo $user['User']['role']; ?></td>
        <td>
            <?php echo $this->Html->link('Đổi mật mã', array('controller' => 'users', 'action' => 'change_password', $user['User']['id'])); ?> |
            <?php echo $this->Html->link('Xóa', array('controller' => 'users', 'action' => 'delete', $user['User']['id']), array(), "Bạn có chắc xóa user này?"); ?>
        </td>
    </tr>
    <?php endforeach; ?>
</table>

<?php echo $this->element('paginator'); ?>